package com.telit.uav.dao;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.telit.uav.dto.UavFlyRecordDTO;
import com.telit.uav.entity.AppUavTrackDetail;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;


/**
 * @Author:zhangwei
 * @Description:
 * @Time:Created on 2021/9/18 10:04
 */
@Repository
public interface FlightDetailsDao {
    /**
     * 查询任务状态
     * @param taskId
     * @return
     */
    String selectTaskStatusByTaskId(Long taskId);

    /**
     *获取任务已完成的飞行时间轴
     * @param taskId
     * @return
     */
    Map<String, Object> selectTimeAxisByEnd(Long taskId);

    /**
     *获取任务已完成的飞行时间轴
     * @param taskId
     * @return
     */
    Map<String, Object> selectTimeAxisByOngoing(@Param("taskId") Long taskId, @Param("userId") Long userId);

    /**
     * 根据任务id、userId获取飞行轨迹信息
     * @param taskId
     * @param userId
     * @return
     */
    List<AppUavTrackDetail> selectUavTrackDetail(@Param("taskId") Long taskId, @Param("userId") Long userId);

    /**
     * 分页条件查询飞行记录列表
     * @param uavFlyRecordDTOIPage
     * @param uavFlyRecordDTO
     * @return
     */
    IPage<UavFlyRecordDTO> selectFlyRecordByPage(@Param("uavFlyRecordDTOIPage") IPage<UavFlyRecordDTO> uavFlyRecordDTOIPage, @Param("uavFlyRecordDTO") UavFlyRecordDTO uavFlyRecordDTO);

    /**
     * 获取最大高度
     * @param taskId
     * @param userId
     * @return
     */
    String selectMaxHeight(@Param("taskId") Long taskId, @Param("userId") Long userId);

    /**
     * 查询轨迹详情
     * @param taskId
     * @param userId
     * @return
     */
    List<AppUavTrackDetail> queryTrackDetail(@Param("taskId") Long taskId, @Param("userId") Long userId);
}
